-- ----------------------------- 2023-07-24 add by zhoujq--------------begin

-- 建表语句
CREATE TABLE T_LIMS_PJ_RESULT_HISTORY( 
    ID NUMBER NOT NULL,
    FOLDERID NUMBER NULL,
    FOLDEREQUIPID NUMBER NULL,
    TASKID NUMBER NULL,
    FINALRESULT VARCHAR2(200)  NULL,
    JUDGE VARCHAR2(200)  NULL,
    UNIT VARCHAR2(100)  NULL,
    COLOR VARCHAR2(100)  NULL,
    RESULTSTATUS VARCHAR2(200)  NULL,
    REFERTIP VARCHAR2(200)  NULL,
    CREATEDBYID VARCHAR2(36)  NULL,
    CREATEDBYNAME VARCHAR2(60)  NULL,
    CREATEDTIME DATE NULL,
    CREATEDBYORGID VARCHAR2(36)  NULL,
    CREATEDBYORGNAME VARCHAR2(270)  NULL
 );
COMMENT ON TABLE T_LIMS_PJ_RESULT_HISTORY IS '普检检测目的值操作记录';
COMMENT ON COLUMN T_LIMS_PJ_RESULT_HISTORY.ID IS '主键';
COMMENT ON COLUMN T_LIMS_PJ_RESULT_HISTORY.FOLDERID IS '任务单ID';
COMMENT ON COLUMN T_LIMS_PJ_RESULT_HISTORY.FOLDEREQUIPID IS '任务单设备ID';
COMMENT ON COLUMN T_LIMS_PJ_RESULT_HISTORY.TASKID IS '任务ID';
COMMENT ON COLUMN T_LIMS_PJ_RESULT_HISTORY.FINALRESULT IS '最终结果';
COMMENT ON COLUMN T_LIMS_PJ_RESULT_HISTORY.JUDGE IS '判定结果';
COMMENT ON COLUMN T_LIMS_PJ_RESULT_HISTORY.UNIT IS '单位';
COMMENT ON COLUMN T_LIMS_PJ_RESULT_HISTORY.COLOR IS '判定结果颜色';
COMMENT ON COLUMN T_LIMS_PJ_RESULT_HISTORY.RESULTSTATUS IS '结果状态(正常/异常/危急)';
COMMENT ON COLUMN T_LIMS_PJ_RESULT_HISTORY.REFERTIP IS '危急提示';
COMMENT ON COLUMN T_LIMS_PJ_RESULT_HISTORY.CREATEDBYID IS '制单人编码';
COMMENT ON COLUMN T_LIMS_PJ_RESULT_HISTORY.CREATEDBYNAME IS '制单人名称';
COMMENT ON COLUMN T_LIMS_PJ_RESULT_HISTORY.CREATEDTIME IS '制单时间';
COMMENT ON COLUMN T_LIMS_PJ_RESULT_HISTORY.CREATEDBYORGID IS '制单人单位编码';
COMMENT ON COLUMN T_LIMS_PJ_RESULT_HISTORY.CREATEDBYORGNAME IS '制单人单位名称';

ALTER TABLE T_LIMS_PJ_RESULT_HISTORY ADD CONSTRAINT PK_LIMS_PJ_RESULT_HISTORY PRIMARY KEY (ID);

-- 旧版审计跟踪，跟踪配置变更语句

INSERT INTO T_CORE_AT_CONFIG_LINE (ID,CONFIGID,COLUMNID,AUDITTRAIL,CREATEDTIME) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PJ_RESULT_HISTORY','ID','1',CURRENT_TIMESTAMP);
INSERT INTO T_CORE_AT_CONFIG_LINE (ID,CONFIGID,COLUMNID,AUDITTRAIL,CREATEDTIME) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PJ_RESULT_HISTORY','FOLDERID','1',CURRENT_TIMESTAMP);
INSERT INTO T_CORE_AT_CONFIG_LINE (ID,CONFIGID,COLUMNID,AUDITTRAIL,CREATEDTIME) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PJ_RESULT_HISTORY','FOLDEREQUIPID','1',CURRENT_TIMESTAMP);
INSERT INTO T_CORE_AT_CONFIG_LINE (ID,CONFIGID,COLUMNID,AUDITTRAIL,CREATEDTIME) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PJ_RESULT_HISTORY','TASKID','1',CURRENT_TIMESTAMP);
INSERT INTO T_CORE_AT_CONFIG_LINE (ID,CONFIGID,COLUMNID,AUDITTRAIL,CREATEDTIME) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PJ_RESULT_HISTORY','FINALRESULT','1',CURRENT_TIMESTAMP);
INSERT INTO T_CORE_AT_CONFIG_LINE (ID,CONFIGID,COLUMNID,AUDITTRAIL,CREATEDTIME) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PJ_RESULT_HISTORY','JUDGE','1',CURRENT_TIMESTAMP);
INSERT INTO T_CORE_AT_CONFIG_LINE (ID,CONFIGID,COLUMNID,AUDITTRAIL,CREATEDTIME) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PJ_RESULT_HISTORY','UNIT','1',CURRENT_TIMESTAMP);
INSERT INTO T_CORE_AT_CONFIG_LINE (ID,CONFIGID,COLUMNID,AUDITTRAIL,CREATEDTIME) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PJ_RESULT_HISTORY','COLOR','1',CURRENT_TIMESTAMP);
INSERT INTO T_CORE_AT_CONFIG_LINE (ID,CONFIGID,COLUMNID,AUDITTRAIL,CREATEDTIME) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PJ_RESULT_HISTORY','RESULTSTATUS','1',CURRENT_TIMESTAMP);
INSERT INTO T_CORE_AT_CONFIG_LINE (ID,CONFIGID,COLUMNID,AUDITTRAIL,CREATEDTIME) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PJ_RESULT_HISTORY','REFERTIP','1',CURRENT_TIMESTAMP);
INSERT INTO T_CORE_AT_CONFIG_LINE (ID,CONFIGID,COLUMNID,AUDITTRAIL,CREATEDTIME) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PJ_RESULT_HISTORY','CREATEDBYID','1',CURRENT_TIMESTAMP);
INSERT INTO T_CORE_AT_CONFIG_LINE (ID,CONFIGID,COLUMNID,AUDITTRAIL,CREATEDTIME) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PJ_RESULT_HISTORY','CREATEDBYNAME','1',CURRENT_TIMESTAMP);
INSERT INTO T_CORE_AT_CONFIG_LINE (ID,CONFIGID,COLUMNID,AUDITTRAIL,CREATEDTIME) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PJ_RESULT_HISTORY','CREATEDTIME','1',CURRENT_TIMESTAMP);
INSERT INTO T_CORE_AT_CONFIG_LINE (ID,CONFIGID,COLUMNID,AUDITTRAIL,CREATEDTIME) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PJ_RESULT_HISTORY','CREATEDBYORGID','1',CURRENT_TIMESTAMP);
INSERT INTO T_CORE_AT_CONFIG_LINE (ID,CONFIGID,COLUMNID,AUDITTRAIL,CREATEDTIME) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PJ_RESULT_HISTORY','CREATEDBYORGNAME','1',CURRENT_TIMESTAMP);
COMMIT;

-- 审计跟踪V2，跟踪配置变更语句

INSERT INTO T_CORE_AUDIT_CONFIG_COLUMN (ID,CONFIGID,"COLUMN",AUDITABLE) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PJ_RESULT_HISTORY','ID','1');
INSERT INTO T_CORE_AUDIT_CONFIG_COLUMN (ID,CONFIGID,"COLUMN",AUDITABLE) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PJ_RESULT_HISTORY','FOLDERID','1');
INSERT INTO T_CORE_AUDIT_CONFIG_COLUMN (ID,CONFIGID,"COLUMN",AUDITABLE) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PJ_RESULT_HISTORY','FOLDEREQUIPID','1');
INSERT INTO T_CORE_AUDIT_CONFIG_COLUMN (ID,CONFIGID,"COLUMN",AUDITABLE) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PJ_RESULT_HISTORY','TASKID','1');
INSERT INTO T_CORE_AUDIT_CONFIG_COLUMN (ID,CONFIGID,"COLUMN",AUDITABLE) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PJ_RESULT_HISTORY','FINALRESULT','1');
INSERT INTO T_CORE_AUDIT_CONFIG_COLUMN (ID,CONFIGID,"COLUMN",AUDITABLE) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PJ_RESULT_HISTORY','JUDGE','1');
INSERT INTO T_CORE_AUDIT_CONFIG_COLUMN (ID,CONFIGID,"COLUMN",AUDITABLE) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PJ_RESULT_HISTORY','UNIT','1');
INSERT INTO T_CORE_AUDIT_CONFIG_COLUMN (ID,CONFIGID,"COLUMN",AUDITABLE) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PJ_RESULT_HISTORY','COLOR','1');
INSERT INTO T_CORE_AUDIT_CONFIG_COLUMN (ID,CONFIGID,"COLUMN",AUDITABLE) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PJ_RESULT_HISTORY','RESULTSTATUS','1');
INSERT INTO T_CORE_AUDIT_CONFIG_COLUMN (ID,CONFIGID,"COLUMN",AUDITABLE) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PJ_RESULT_HISTORY','REFERTIP','1');
INSERT INTO T_CORE_AUDIT_CONFIG_COLUMN (ID,CONFIGID,"COLUMN",AUDITABLE) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PJ_RESULT_HISTORY','CREATEDBYID','1');
INSERT INTO T_CORE_AUDIT_CONFIG_COLUMN (ID,CONFIGID,"COLUMN",AUDITABLE) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PJ_RESULT_HISTORY','CREATEDBYNAME','1');
INSERT INTO T_CORE_AUDIT_CONFIG_COLUMN (ID,CONFIGID,"COLUMN",AUDITABLE) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PJ_RESULT_HISTORY','CREATEDTIME','1');
INSERT INTO T_CORE_AUDIT_CONFIG_COLUMN (ID,CONFIGID,"COLUMN",AUDITABLE) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PJ_RESULT_HISTORY','CREATEDBYORGID','1');
INSERT INTO T_CORE_AUDIT_CONFIG_COLUMN (ID,CONFIGID,"COLUMN",AUDITABLE) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PJ_RESULT_HISTORY','CREATEDBYORGNAME','1');
COMMIT;
CALL INSERTI18N('T_LIMS_PJ_RESULT_HISTORY.SERVICE_NAME', '普检检测目的值操作记录', '普检检测目的值操作记录', 'zh-CN', '普检检测目的值操作记录');
CALL INSERTI18N('T_LIMS_PJ_RESULT_HISTORY.ID', '普检检测目的值操作记录的主键', '主键', 'zh-CN', '主键');
CALL INSERTI18N('T_LIMS_PJ_RESULT_HISTORY.FOLDERID', '普检检测目的值操作记录的任务单ID', '任务单ID', 'zh-CN', '任务单ID');
CALL INSERTI18N('T_LIMS_PJ_RESULT_HISTORY.FOLDEREQUIPID', '普检检测目的值操作记录的任务单设备ID', '任务单设备ID', 'zh-CN', '任务单设备ID');
CALL INSERTI18N('T_LIMS_PJ_RESULT_HISTORY.TASKID', '普检检测目的值操作记录的任务ID', '任务ID', 'zh-CN', '任务ID');
CALL INSERTI18N('T_LIMS_PJ_RESULT_HISTORY.FINALRESULT', '普检检测目的值操作记录的最终结果', '最终结果', 'zh-CN', '最终结果');
CALL INSERTI18N('T_LIMS_PJ_RESULT_HISTORY.JUDGE', '普检检测目的值操作记录的判定结果', '判定结果', 'zh-CN', '判定结果');
CALL INSERTI18N('T_LIMS_PJ_RESULT_HISTORY.UNIT', '普检检测目的值操作记录的单位', '单位', 'zh-CN', '单位');
CALL INSERTI18N('T_LIMS_PJ_RESULT_HISTORY.COLOR', '普检检测目的值操作记录的判定结果颜色', '判定结果颜色', 'zh-CN', '判定结果颜色');
CALL INSERTI18N('T_LIMS_PJ_RESULT_HISTORY.RESULTSTATUS', '普检检测目的值操作记录的结果状态(正常/异常/危急)', '结果状态(正常/异常/危急)', 'zh-CN', '结果状态(正常/异常/危急)');
CALL INSERTI18N('T_LIMS_PJ_RESULT_HISTORY.REFERTIP', '普检检测目的值操作记录的危急提示', '危急提示', 'zh-CN', '危急提示');
CALL INSERTI18N('T_LIMS_PJ_RESULT_HISTORY.CREATEDBYID', '普检检测目的值操作记录的制单人编码', '制单人编码', 'zh-CN', '制单人编码');
CALL INSERTI18N('T_LIMS_PJ_RESULT_HISTORY.CREATEDBYNAME', '普检检测目的值操作记录的制单人名称', '制单人名称', 'zh-CN', '制单人名称');
CALL INSERTI18N('T_LIMS_PJ_RESULT_HISTORY.CREATEDTIME', '普检检测目的值操作记录的制单时间', '制单时间', 'zh-CN', '制单时间');
CALL INSERTI18N('T_LIMS_PJ_RESULT_HISTORY.CREATEDBYORGID', '普检检测目的值操作记录的制单人单位编码', '制单人单位编码', 'zh-CN', '制单人单位编码');
CALL INSERTI18N('T_LIMS_PJ_RESULT_HISTORY.CREATEDBYORGNAME', '普检检测目的值操作记录的制单人单位名称', '制单人单位名称', 'zh-CN', '制单人单位名称');
CALL INSERTI18N('BASEMODULE.BUSINESS.PJRESULTEDITHISTORYS.MODAL.ADD', '新增', '新增', 'zh-CN', '新增');
CALL INSERTI18N('BASEMODULE.BUSINESS.PJRESULTEDITHISTORYS.TAB.BASE_INFO', '基本信息', '基本信息', 'zh-CN', '基本信息');
CALL INSERTI18N('BASEMODULE.BUSINESS.PJRESULTEDITHISTORYS.BUTTON.BUTTON', '按钮', '按钮', 'zh-CN', '按钮');
CALL INSERTI18N('BASEMODULE.BUSINESS.PJRESULTEDITHISTORYS.TIP.TIP', '提示框', '提示框', 'zh-CN', '提示框');
CALL INSERTI18N('BASEMODULE.BUSINESS.PJRESULTEDITHISTORYS.MODAL.MODAL', '对话框', '对话框', 'zh-CN', '对话框');

-- 创建菜单语句
INSERT INTO T_CORE_MENU (ID, MENUNAME, HREF, PARENTID, ORDERNO, ICON, MENUINITNAME)
VALUES ('2023072401', '操作历史', '/secure/basemodule/business/pj-result-historys/page/edit-list', 'null', '2023072401', 'null', '操作历史');

INSERT INTO T_CORE_TABLE (ID, AUDITABLE, ATTACHMENT)
VALUES ('T_LIMS_PJ_RESULT_HISTORY', '0', '0');


COMMIT;

-- ----------------------------- 2023-07-24 add by zhoujq------------end